<!doctype HTML>
<script src="../../resources/testharness.js"></script>
<script src="../../resources/testharnessreport.js"></script>
<script src="../assert_selection.js"></script>
<style>
p {
    font-size: 20px;
    line-height: 22px;
    color: red;
}
</style>
<div id="log"></div>
<script>
const isMac = navigator.platform.indexOf('Mac') === 0;
test(() => {
    assert_selection(
        '<div contenteditable="true"><h1>Heading 1:</h1>^<p>|paragraph was merged.</p></div>',
        'delete',
        '<div contenteditable="true"><h1>Heading 1:|paragraph was merged.</h1></div>',
        'Make a paragraph into a heading');
    assert_selection(
        '<div contenteditable="true"><pre>Preformatted text:</pre>^<p>|paragraph was merged.</p></div>',
        'delete',
        '<div contenteditable="true"><pre>Preformatted text:|paragraph was merged.</pre></div>',
        'Make a paragraph into a pre');
    assert_selection(
        '<div contenteditable="true"><ul><li>List Item:</li></ul>^<p>|paragraph was merged.</p></div>',
        'delete',
        '<div contenteditable="true"><ul><li>List Item:|paragraph was merged.</li></ul></div>',
        'Make a paragraph into a list');
    assert_selection(
        '<div contenteditable="true"><table><tbody><tr><td>Table:</td></tr></tbody></table>^<p>|paragraph was merged.</p></div>',
        'delete',
        isMac
            ? '<div contenteditable="true"><table><tbody><tr><td>Table:|paragraph was merged.</td></tr></tbody></table></div>'
            : '<div contenteditable="true"><table><tbody><tr><td>Table:</td></tr></tbody></table>|paragraph was merged.</div>',
        isMac
            ? 'Make a paragraph into a table'
            : 'Do not merge paragraph into a table');
}, 'merge into a block by backspace');
</script>
